using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraEditors;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;

namespace WorkGroup.Controls
{
    public class WgButton : SimpleButton, IWgControl
    {
        private Keys shortcutKeys;
        private string languageCode;
        private Control focusedControl;

        [Bindable(true)]
        [Category("WorkGroup")]
        [DefaultValue("")]
        [Description("")]
        [Localizable(true)]
        public Keys ShortcutKeys
        {
            get { return shortcutKeys; }
            set { shortcutKeys = value; }
        }

        [Bindable(true)]
        [Category("WorkGroup")]
        [DefaultValue("")]
        [Description("Dil Kodu")]
        [Localizable(true)]
        public string LanguageCode
        {
            get
            {
                return languageCode;
            }
            set
            {
                languageCode = value;
            }
        }
        
        [Bindable(true)]
        [Category("WorkGroup")]
        [DefaultValue("")]
        [Description("")]
        [Localizable(true)]
        public Control FocusedControl
        {
            get { return focusedControl; }
            set { focusedControl = value; }
        }
        
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);
            if (e.KeyCode == Keys.Enter)
                if (focusedControl != null)
                    focusedControl.Focus();
        }

        public void SetFont(FontFamily fontName, int size, FontStyle style)
        {
            this.Font = new Font(fontName, size, style);
        }
       
    }
}
